Question Description
Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared
according to
the GATE exam syllabus. Information about Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam.
Find important definitions, questions, meanings, examples, exercises and tests below for Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer?.
Solutions for Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE.
Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of
Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer?, a detailed solution for Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an
ample number of questions to practice Consider the C program below.#include int *A, stkTop;int stkFunc(int opcode, int val){static int size=0, stkTop=0;switch (opcode) {case -1: size = val; break;case 0: if (stkTop < size) A[stkTop++] = val; break; default: if (stkTop) return A[--stkTop];}return -1;}int main(){int B[20]; A = B; stkTop = -1;stkFunc (-1, 10);stkFunc ( 0, 5);stkFunc ( 0, 10);printf ("%d\n", stkFunc(1, 0) + stkFunc(1,0));}The value printed by the above program is ___________.a)5b)10c)15d)20Correct answer is option 'C'. Can you explain this answer? tests, examples and also practice GATE tests.